<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    fetch('https://jsonplaceholder.typicode.com/posts/1')
    .then(res => {
        console.log("success");
    }).catch(err => {
        console.log("failed");
    })
</script>
</html>